package id.amikom.jogjabankfinder;

import java.text.DecimalFormat;

import android.content.Context;
import android.location.Location;
import android.widget.Toast;

public class Utils
{
	private static final boolean	DEBUG	= true;

	public static double getRoundTwoDecimal(double d)
	{
		DecimalFormat twoDForm = new DecimalFormat("#.###");
		return Double.valueOf(twoDForm.format(d));
	}

	public static double getDistance(Location locA, Location locB)
	{
		return locA.distanceTo(locB);
	}

	public static void TRACE(String arg)
	{
		if (DEBUG)
		{
			System.out.println(arg);
		}
	}

	public static void TOAST(String arg, Context con)
	{
		if (DEBUG)
		{
			Toast.makeText(con, arg, Toast.LENGTH_SHORT).show();
		}

	}

	public static boolean isDebug()
	{
		if (DEBUG)
		{
			return true;
		}

		return false;

	}

}
